package com.chencs.web5.app.service;

import com.chencs.vo.net.request.ProductListRequest;
import com.chencs.vo.net.request.ProductRequest;
import com.chencs.vo.net.request.PushRequest;
import com.chencs.webmvc.rest.RestFullTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class H5Service {

    @Autowired
    RestFullTemplate restTemplate;

    /**标志远程服务url**/
    private static final String URLPATH = "service-common/app/product/";

    public String getList() throws Exception{
        String ret = restTemplate.postForObject(URLPATH + "getList", String.class,"");
        return ret;
    }


    public String getProductList( ProductListRequest request){
        String ret = restTemplate.postForObject(URLPATH + "getProductList", String.class,request);
        return ret;

    }

    public String topList( PushRequest request){
        String ret = restTemplate.postForObject(URLPATH + "topList", String.class,request);
        return ret;

    }

    /**getProduct
     * 获取商品詳情
     * @return
     */
    public String findProduct(ProductRequest request){
        String ret = restTemplate.postForObject(URLPATH + "findProduct", String.class,request);
        return ret;

    }

}
